package com.example.online.music.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.online.music.model.domain.Comment;
import com.example.online.music.model.response.CommentResponsePO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper extends BaseMapper<Comment> {

    /**
     * @Description: 更新点赞数：用于用户点赞或取消点赞
     * @CreateTime:
     * @param: id 评论id
     * @param: i 1 点赞，-1 取消点赞
     **/
    void updateUpById(@Param("id") Integer id, @Param("up") int up);

    /**
     * @Description: 根据歌单id查询所有评论列表
     * @CreateTime:
     * @param: songListId
     * @return: java.util.List<com.example.online.music.model.response.CommentResponsePO>
     **/
    List<CommentResponsePO> selectCommentListBySongListId(Integer songListId);
}
